import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home/Home.vue'
Vue.use(VueRouter)

const routes = [
	
	{
		path: '/',
		name: '首页',
		component: Home
	},
	{
		path: '/home',
		name: '首页',
		component: Home,
		//PS：在子路由中可以不用加斜杠，否则会默认为根目录下的路由
		children: [{
				path: 'selected',
				name: '精选',
				component: () => import( /*webpackChunkName:"selected"*/ '../views/Home/Selected/Selected.vue')
			},
			{
				path: 'discount',
				name: '优惠',
				component: () => import( /*webpackChunkName:"discount"*/ '../views/Home/Discount/Discount.vue')
			},
			{
				path: 'find',
				name: '发现',
				component: () => import( /*webpackChunkName:"find"*/ '../views/Home/Find/Find.vue')
			},
			{
				path: 'haitao',
				name: '海淘',
				component: () => import( /*webpackChunkName:"haitao"*/ '../views/Home/HaiTao/HaiTao.vue')
			},
			{
				path: 'original',
				name: '原创',
				component: () => import( /*webpackChunkName:"original"*/ '../views/Home/Original/Original.vue')
			},
		]
	},
	{
		path: '/Category',
		name: '分类',
		component: () => import( /* webpackChunkName: "Category" */ '../views/Category/Category.vue')
	},
	{
		path: '/profile',
		name: '我的',
		component: () => import( /* webpackChunkName: "Profile" */ '../views/Profile/Profile.vue')
	}
]

const router = new VueRouter({
	mode:'history',
	routes,
})

export default router
